function findOdd1(arr){
    let obj = arr.reduce((pre,cur) => {
        pre[cur] ? pre[cur]++ : (pre[cur]=1);
        return pre;
    },{})
    let num;
    Object.entries(obj).forEach(item=>{
        if(item[1]%2) num = item[0];
    })
    return num;
}

function findOdd2(A) {
    return A.reduce((c,v)=>{return c^v;},0);
}


function findOdd3(arr) {
    return arr.find((item, index) => arr.filter(el => el == item).length % 2)
}

console.log(findOdd3([1,3,3,1,4]))